package com.fs.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor  //含参构造
@NoArgsConstructor  //无参构造
@Accessors(chain = true) //开启链式编程
@TableName("user")
public class User implements Serializable{
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId(type=IdType.AUTO)
    private Integer id;
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     */
    private String password;
    /**
     * 盐
     */
    private String salt;
    /**
     * 电话
     */
    private String phone;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 状态
     */
    private Boolean status;
    /**
     * 余额
     */
    private Integer balance;
    /**
     * 积分
     */
    private Integer score;
    /**
     * 错误登录次数
     */
    private Integer errNum;
    /**
     * 错误登录时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date errTime;
    /**
     *
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date created;
    /**
     *
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date updated;

    @TableField(exist = false)
    private UserInfo userInfo;
}
